/*
@author: lyf
@file: s.go
@time: 2022/10/14 16:23
*/
package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main()  {
	g()

}
func g()  {
	rand.Seed(time.Now().UnixNano())
Loop:
	li := map[string]string{
		"A":"A", "B":"B", "C":"C", "D":"D", "E":"E",
	}
	gift := []string{"A", "B", "C", "D", "E"}
	for k,_:=range li{
		n := rand.Intn(len(gift))
		send := gift[n]
		if send !=li[k]{
			gift = append(gift[:n], gift[n+1:]...)
			li[k] = send
		} else {
			continue
		}
	}
	if len(gift) == 0 {
		fmt.Println(li)
	} else {
		goto Loop
	}
}
